import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, ManyToOne, OneToMany, JoinColumn, ManyToMany, JoinTable } from 'typeorm';

@Entity('system_menu')
export class SystemMenu extends BaseEntity {
  @PrimaryGeneratedColumn({ comment: '菜单id' })
  menu_id: number;

  @Column({ default: 0, comment: '菜单pid' })
  menu_pid: number;

  @Column({ type: 'tinyint', default: 0, comment: '菜单类型，0目录1菜单2按钮' })
  menu_type: number;

  @Column({ length: 100, default: '', comment: '菜单名称' })
  menu_name: string;

  @Column({ length: 100, default: '', comment: '菜单链接（权限标识）' })
  menu_url: string;

  @Column({ length: 127, default: '', comment: '路由地址' })
  path: string;

  @Column({ length: 127, default: '', comment: '路由名称' })
  name: string;

  @Column({ length: 127, default: '', comment: '组件地址' })
  component: string;

  @Column({ length: 63, default: '', comment: '菜单图标' })
  meta_icon: string;

  @Column({ length: 255, default: '', comment: '路由参数' })
  meta_query: string;

  @Column({ type: 'tinyint', default: 0, comment: '是否隐藏，1是0否' })
  hidden: number;

  @Column({ type: 'tinyint', default: 1, comment: '是否缓存，1是0否' })
  keep_alive: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否始终显示，1是0否' })
  always_show: number;

  @Column({ default: 250, comment: '排序' })
  sort: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否免登，1是0否' })
  is_unlogin: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否免权，1是0否' })
  is_unauth: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否免限，1是0否' })
  is_unrate: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否禁用，1是0否' })
  is_disable: number;

  @Column({ type: 'tinyint', default: 0, comment: '是否删除，1是0否' })
  is_delete: number;

  @Column({ default: 0, comment: '添加用户id' })
  create_uid: number;

  @Column({ default: 0, comment: '修改用户id' })
  update_uid: number;

  @Column({ default: 0, comment: '删除用户id' })
  delete_uid: number;

  @Column({ type: 'datetime', nullable: true, comment: '添加时间' })
  create_time: Date;

  @Column({ type: 'datetime', nullable: true, comment: '修改时间' })
  update_time: Date;

  @Column({ type: 'datetime', nullable: true, comment: '删除时间' })
  delete_time: Date;
}
